package com.chexiehui.jc.entity;

import com.blankj.utilcode.util.StringUtils;
import com.chexiehui.jc.utils.AppCommonUtil;

import java.io.Serializable;
import java.util.List;

public class MerchantAuthInfo implements Serializable {
    private String id;// (string, optional): 认证id ,
    private String AuthFiles;// (string, optional): 认证文件 ,
    private String companyType;// (string, optional): 公司类型 ,
    private String companyName;// (string, optional): 公司名称 ,
    private String storeName;// (string, optional): 门店名称 ,
    private String storeAdress;// (string, optional): 门店地址 ,
    private String imgs;// (string, optional): 门店图片 ,
    private String envirImgs;// (string, optional): 环境图片 ,
    private int status;// (integer, optional): 状态0审核中1审核通过2审核不通过 ,
    private double lon;// (number, optional): 经度 ,
    private double lat;// (number, optional): 纬度
    private String Opinion;//申请不通过原因

    public String getOpinion() {
        return Opinion == null ? "" : Opinion;
    }

    public void setOpinion(String Opinion) {
        this.Opinion = Opinion;
    }

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAuthFiles() {
        return AuthFiles == null ? "" : AuthFiles;
    }

    public void setAuthFiles(String authFiles) {
        AuthFiles = authFiles;
    }

    public String getCompanyType() {
        return companyType == null ? "" : companyType;
    }

    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }

    public String getCompanyName() {
        return companyName == null ? "" : companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getStoreName() {
        return storeName == null ? "" : storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getStoreAdress() {
        return storeAdress == null ? "" : storeAdress;
    }

    public void setStoreAdress(String storeAdress) {
        this.storeAdress = storeAdress;
    }

    public String getImgs() {
        return imgs == null ? "" : imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public String getEnvirImgs() {
        return envirImgs == null ? "" : envirImgs;
    }

    public void setEnvirImgs(String envirImgs) {
        this.envirImgs = envirImgs;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public void imgsAddUrl(String img){
        if(StringUtils.isTrimEmpty(imgs)){
            imgs = img;
        }else{
            imgs = imgs + "," + img;
        }
    }

    public void imgsRemoveUrl(int position, String img){
        if(!StringUtils.isTrimEmpty(imgs)){
            List<String> list = AppCommonUtil.stringToSplitList(imgs);
            if(list.size() > position && img.contains(list.get(position))){
                list.remove(position);
                imgs = AppCommonUtil.stringListToSplitString(list);
            }
        }
    }

    public void envirImgsAddUrl(String img){
        if(StringUtils.isTrimEmpty(envirImgs)){
            envirImgs = img;
        }else{
            envirImgs = envirImgs + "," + img;
        }
    }

    public void envirImgsRemoveUrl(int position, String img){
        if(!StringUtils.isTrimEmpty(envirImgs)){
            List<String> list = AppCommonUtil.stringToSplitList(envirImgs);
            if(list.size() > position && img.contains(list.get(position))){
                list.remove(position);
                envirImgs = AppCommonUtil.stringListToSplitString(list);
            }
        }
    }
}
